Skip to content

Use std::common_type_t to compare variables using common type - #1494

Closed
leekillough wants to merge 5 commits into
sstsimulator:develfrom
leekillough:use_common_type_for_compare
Closed

Use std::common_type_t to compare variables using common type#1494
leekillough wants to merge 5 commits into
sstsimulator:develfrom
leekillough:use_common_type_for_compare

Conversation

@leekillough

@leekillough leekillough commented Nov 25, 2025

Copy link
Copy Markdown
Contributor

Use std::common_type_t to simplify the comparison of different variable types. If a common type exists for which both operands can be explicitly converted to, then you convert them to this common type and perform the comparison on this common type.

  • Note: std::common_type_t<std::bitset<N>::reference, bool> = bool and std::common_type_t<std::vector<bool>::reference, bool> = bool.
  • std::common_type<T1, T2> is the only <type_traits> class which can have user-defined specializations, as long as at least T1 or T2 is a user-defined type, but I did not need to define a specialization.

Use the same cmp() function which uses std::common_type_t for both variable change-detection as well as regular comparisons.

@github-actions github-actions Bot added AT: WIP Mark PR as a Work in Progress (No Autotesting Performed) AT: CLANG-FORMAT PASS and removed AT: WIP Mark PR as a Work in Progress (No Autotesting Performed) labels Nov 25, 2025
@github-actions

Copy link
Copy Markdown

CLANG-FORMAT TEST - PASSED

@sst-autotester

Copy link
Copy Markdown
Contributor

Status Flag 'Pre-Test Inspection' - - This Pull Request Requires Inspection... The code must be inspected by a member of the Team before Testing/Merging
NO INSPECTION HAS BEEN PERFORMED ON THIS PULL REQUEST! - This PR must be inspected by setting label 'AT: PRE-TEST INSPECTED'.

@leekillough
leekillough marked this pull request as draft November 29, 2025 15:36
@leekillough

leekillough commented Nov 30, 2025

Copy link
Copy Markdown
Contributor Author

Converted to draft because I am still working on it, and one of our debugger tests fails, probably because of this change.

This change does not cause test failures. It's due to #1492

@leekillough
leekillough force-pushed the use_common_type_for_compare branch from f8276ad to b8364ad Compare November 30, 2025 09:34
@leekillough
leekillough marked this pull request as ready for review November 30, 2025 09:35
@github-actions github-actions Bot added AT: WIP Mark PR as a Work in Progress (No Autotesting Performed) and removed AT: WIP Mark PR as a Work in Progress (No Autotesting Performed) labels Nov 30, 2025
@github-actions

Copy link
Copy Markdown

CLANG-FORMAT TEST - PASSED

@sst-autotester

Copy link
Copy Markdown
Contributor

Status Flag 'Pre-Test Inspection' - - This Pull Request Requires Inspection... The code must be inspected by a member of the Team before Testing/Merging
NO INSPECTION HAS BEEN PERFORMED ON THIS PULL REQUEST! - This PR must be inspected by setting label 'AT: PRE-TEST INSPECTED'.

@leekillough
leekillough force-pushed the use_common_type_for_compare branch from b8364ad to 898c1ee Compare November 30, 2025 20:15
@github-actions github-actions Bot added AT: WIP Mark PR as a Work in Progress (No Autotesting Performed) and removed AT: WIP Mark PR as a Work in Progress (No Autotesting Performed) labels Nov 30, 2025
@github-actions

Copy link
Copy Markdown

CLANG-FORMAT TEST - PASSED

@sst-autotester

Copy link
Copy Markdown
Contributor

Status Flag 'Pre-Test Inspection' - - This Pull Request Requires Inspection... The code must be inspected by a member of the Team before Testing/Merging
NO INSPECTION HAS BEEN PERFORMED ON THIS PULL REQUEST! - This PR must be inspected by setting label 'AT: PRE-TEST INSPECTED'.

feldergast
feldergast previously approved these changes Dec 1, 2025
@sst-autotester

Copy link
Copy Markdown
Contributor

Status Flag 'Pre-Test Inspection' - SUCCESS: The last commit to this Pull Request has been INSPECTED by label AT: PRE-TEST INSPECTED! Autotester is Removing Label; this inspection will remain valid until a new commit to source branch is performed.

@sst-autotester

Copy link
Copy Markdown
Contributor

Status Flag 'Pull Request AutoTester' - Testing Jenkins Projects:

Pull Request Auto Testing STARTING (click to expand)

Build Information

Test Name: SST__AutotestGen2_NewFW_sst-test_OMPI-4.1.4_PY3.9_sst-elements

  • Build Num: 2372
  • Status: STARTED

Build Information

Test Name: SST__AutotestGen2_NewFW_sst-test_OMPI-4.1.4_PY3.9_sst-elements_MR-2

  • Build Num: 2326
  • Status: STARTED

Build Information

Test Name: SST__AutotestGen2_NewFW_sst-test_OMPI-4.1.4_PY3.9_sst-elements_MT-2

  • Build Num: 2325
  • Status: STARTED

Build Information

Test Name: SST__AutotestGen2_NewFW_sst-test_OMPI-4.1.4_PY3.9_sst-core_Make-Dist

  • Build Num: 970
  • Status: STARTED

Build Information

Test Name: SST__AutotestGen2_NewFW_OSX-15-XC15-ARM2_OMPI-4.1.6_PY3.10_sst-elements

  • Build Num: 876
  • Status: STARTED

Using Repos:

Repo: CORE (leekillough/sst-core)
  • Branch: use_common_type_for_compare
  • SHA: 898c1ee
  • Mode: TEST_REPO
Repo: SQE (sstsimulator/sst-sqe)
  • Branch: devel
  • SHA: 1e54a5e211d27c88697dab709c0b1d3293cd4a1e
  • Mode: SUPPORT_REPO
Repo: ELEMENTS (sstsimulator/sst-elements)
  • Branch: devel
  • SHA: ad0782067f71d28b5aeebc341391b976bf6fd818
  • Mode: SUPPORT_REPO
Repo: MACRO (sstsimulator/sst-macro)
  • Branch: devel
  • SHA: 489f035111339bbd94e9db661a68c1b2cd7faf77
  • Mode: SUPPORT_REPO

Pull Request Author: leekillough

@sst-autotester

Copy link
Copy Markdown
Contributor

Status Flag 'Pull Request AutoTester' - Jenkins Testing: 1 or more Jobs FAILED

Note: Testing will normally be attempted again in approx. 4 Hrs. If a change to the PR source branch occurs, the testing will be attempted again on next available autotester run.

Pull Request Auto Testing has FAILED (click to expand)

Job: SST__AutotestGen2_NewFW_sst-test_OMPI-4.1.4_PY3.9_sst-elements

  • Result: FAILED
  • Build #: 2372
  • URL: Jenkins server at https://sst-jenkins.sandia.gov/view/SST/job/SST__AutotestGen2_NewFW_sst-test_OMPI-4.1.4_PY3.9_sst-elements/2372/consoleFull
  • Job: - Status: FAILURE

Job: SST__AutotestGen2_NewFW_sst-test_OMPI-4.1.4_PY3.9_sst-elements_MR-2

  • Result: FAILED
  • Build #: 2326
  • URL: Jenkins server at https://sst-jenkins.sandia.gov/view/SST/job/SST__AutotestGen2_NewFW_sst-test_OMPI-4.1.4_PY3.9_sst-elements_MR-2/2326/consoleFull
  • Job: - Status: FAILURE

Job: SST__AutotestGen2_NewFW_sst-test_OMPI-4.1.4_PY3.9_sst-elements_MT-2

  • Result: FAILED
  • Build #: 2325
  • URL: Jenkins server at https://sst-jenkins.sandia.gov/view/SST/job/SST__AutotestGen2_NewFW_sst-test_OMPI-4.1.4_PY3.9_sst-elements_MT-2/2325/consoleFull
  • Job: - Status: FAILURE

Job: SST__AutotestGen2_NewFW_sst-test_OMPI-4.1.4_PY3.9_sst-core_Make-Dist

  • Result: FAILED
  • Build #: 970
  • URL: Jenkins server at https://sst-jenkins.sandia.gov/view/SST/job/SST__AutotestGen2_NewFW_sst-test_OMPI-4.1.4_PY3.9_sst-core_Make-Dist/970/consoleFull
  • Job: - Status: FAILURE

Job: SST__AutotestGen2_NewFW_OSX-15-XC15-ARM2_OMPI-4.1.6_PY3.10_sst-elements

  • Result: PASSED
  • Build #: 876
  • URL: Jenkins server at https://sst-jenkins.sandia.gov/view/SST/job/SST__AutotestGen2_NewFW_OSX-15-XC15-ARM2_OMPI-4.1.6_PY3.10_sst-elements/876/consoleFull

@sst-autotester

Copy link
Copy Markdown
Contributor

Status Flag 'Pull Request AutoTester' - GitHub reports Mergeable status = False

@github-actions github-actions Bot added AT: WIP Mark PR as a Work in Progress (No Autotesting Performed) and removed AT: WIP Mark PR as a Work in Progress (No Autotesting Performed) labels Dec 2, 2025
@github-actions

github-actions Bot commented Dec 2, 2025

Copy link
Copy Markdown

CLANG-FORMAT TEST - PASSED

@sst-autotester

Copy link
Copy Markdown
Contributor

Status Flag 'Pre-Test Inspection' - - This Pull Request Requires Inspection... The code must be inspected by a member of the Team before Testing/Merging
NO INSPECTION HAS BEEN PERFORMED ON THIS PULL REQUEST! - This PR must be inspected by setting label 'AT: PRE-TEST INSPECTED'.

@github-actions github-actions Bot added AT: WIP Mark PR as a Work in Progress (No Autotesting Performed) and removed AT: WIP Mark PR as a Work in Progress (No Autotesting Performed) labels Dec 2, 2025
@github-actions

github-actions Bot commented Dec 2, 2025

Copy link
Copy Markdown

CLANG-FORMAT TEST - PASSED

@leekillough

Copy link
Copy Markdown
Contributor Author

Was included in #1492

@leekillough leekillough closed this Dec 5, 2025
@leekillough
leekillough deleted the use_common_type_for_compare branch December 10, 2025 09:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants